export const state = () => ({
  locales: [
    {code: 'zh', label: '简体中文'},
    {code: 'en', label: 'English'},
    {code: 'ru', label: 'русский'},
  ],
  locale: 'en'
})

export const mutations = {
  SET_LANG(state, locale) {
    if (state.locales.find(item => item.code === locale)) {
      state.locale = locale
    }
  }
}
